package com.yanti.domain.entity.mongodb;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

import java.util.Date;
import java.util.List;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Document(collection = "conversations")
public class Conversation {
    @Id
    private String id;

    @Field("conversation_id")
    private String conversationId;

    @Field("assistant_type")
    private String assistantType;

    @Field("uid")
    private String uid;
    
    private String title;
    
    @Field("created_at")
    private Date createdAt;
    
    @Field("last_updated")
    private Date lastUpdated;
    // 0: 未删除，1: 已删除
    @Field("deleted")
    private Integer deleted;

    private List<ChatMessage> messages;
}